program dimainfo1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
  var: a,s:array of integer;
       q,w,e,z,x,c,r:integer;
begin
  readln(q);
  e:=0;
  r:=0;
for w:=1 to q do
  begin;
  read(a[w]);
  read(s[w]);
  end;
read(x,c);
s[q+1]:=s[1];
a[q+1]:=a[1];
for w:=1 to q do
 e:=e+sqrt(sqr(a[w])+sqr(s[w+1]));
for w:=1 to q do
 e:=e-sqrt(sqr(a[w+1])+sqr(s[w]));
s[q+1]:=c;
a[q+1]:=x;
s[q+2]:=s[1];
a[q+2]:=a[1];
for w:=1 to q+1 do
 r:=r+sqrt(sqr(a[w])+sqr(s[w+1]));
for w:=1 to q+1 do
 r:=r-sqrt(sqr(a[w+1])+sqr(s[w]));
if e=r then
writeln('YES');
else
writeln('NO');
end.
